// import * as actionTypes from './constants'
import { fromJS } from 'immutable'
import * as canstants from './constants'

const defaultState = fromJS({
  headerNavList: [
    {
      "id": 1,
      "name": "首页",
      "value": 1501,
      "icon": "&#xe64d;",
      "url": "./index.html",
      "child_tab": []
    },
    {
      "id": 2,
      "name": "书库",
      "value": 1502,
      "icon": "&#xe77f;",
      "url": "#",
      "child_tab": []
    },
    {
      "id": 3,
      "name": "收藏夹",
      "value": 1505,
      "icon": "&#xe600;",
      "url": "#",
      "child_tab": []
    },
    {
      "id": 4,
      "name": "主题切换",
      "value": 1506,
      "icon": "&#xe60d;",
      "url": "#",
      "child_tab": [
        {
          "id": 6,
          "name": "默认主题",
          "value": 150601
        },
        {
          "id": 7,
          "name": "去特效主题",
          "value": 150602
        }
      ]
    },
    {
      "id": 5,
      "name": "留言板",
      "value": 1507,
      "icon": "&#xe64e;",
      "url": "#",
      "child_tab": []
    }
  ], //导航栏
  backList:[] //背景图
})

export default (state = defaultState, action) => {
  switch (action.type) {
    case canstants.GET_BOOK_BACK_LIST:
      return state.set('backList',action.list)
    case canstants.CHANGE_BACK_LIST:
      return state.set('backList', action.list)
    default:
      return state
  }
}
